//
//  NearFunDetailsVC.m
//  LoveTourism
//
//  Created by qianfeng0 on 16/6/25.
//  Copyright © 2016年 王超. All rights reserved.
//

#import "NearFunDetailsVC.h"

@interface NearFunDetailsVC ()<UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation NearFunDetailsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self LoadingWebView];
    
    //是否隐藏导航栏
//    self.navigationController.navigationBarHidden = YES;
}

- (void)LoadingWebView {
    
    //网址中的中文转换成字符串
    NSString * encodedString = [self.str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:encodedString]];
    
    
    [_webView loadRequest:request];
    
    [self createButton];
    
}

- (void)createButton {
    
    UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(0, 0, 44, 44);
    [button setImage:[UIImage imageNamed:@"iconfont-fanhui"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(onClick) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
}
- (void)onClick {
    
    [self.navigationController popViewControllerAnimated:YES];
}

@end













